<?php
namespace app\admin\validate\Auth;
use bang\validate\Validate;

class MenuValidate extends Validate
{
    protected $rule =   [
        'pid'  => 'require|number',
        'menu_name'   => 'require|max:30',
        'menu_url'   => 'require',
    ];

    protected $message  =   [
        'pid.number' => '父菜单参数出错',
        'menu_name.max'     => '菜单名称最多不能超过25个字符',
    ];

    protected $field = [
        'pid' => "父菜单",
        'menu_name' => "菜单名称",
        'menu_url' => "跳转链接",
    ];

    protected $scene = [
        'add'  =>  ['pid','menu_name'],
        'edit'  =>  [
            'pid' => 'number' ,
            'menu_name' => 'max:30'
        ],
    ];



}